package com.uzykj.modules.sys.web;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.uzykj.core.persistence.Page;
import com.uzykj.core.web.BaseController;
import com.uzykj.modules.sys.entity.MyClass;
import com.uzykj.modules.sys.entity.MyDict;
import com.uzykj.modules.sys.service.MyClassService;
import com.uzykj.modules.sys.service.MyDictService;

@Controller
@RequestMapping(value = "${adminPath}/sys/baoming")
public class BaoMingController extends BaseController{
	@Autowired
	private MyDictService myDictService;
	
	@Autowired
	private MyClassService myClassService;
	
	@RequestMapping(value = "index")
	public String test1(Model model){
		List<MyDict> myDictList = myDictService.findDictDepartName("专业名称");
		model.addAttribute("myDictList", myDictList);
		return "modules/sys/baoming/index";
	}
	
	@ResponseBody
	@RequestMapping(value = {"data", ""})
	public Map<String, Object> data(MyClass myClass, HttpServletRequest request, HttpServletResponse response, Model model) {
		//模拟查注意力训练营,
		// 设置分页参数
		MyClass class1 = new MyClass();
		
		Page<MyClass> page =myClassService.findClassByDepartName(new Page<MyClass>(request, response), "注意力训练营");
		return getBootstrapData(page);
	}
}
